package com.xingchen.loveparttimejob.websocket.pojo;

import java.util.Set;

/**
 * @author 小志
 * @date 2024/11/24 - 15:50
 */
public class Message {
    //消息内容
    private String message;
    // 0是文本消息，1是图片消息
    private int messageType;
    //发送人
    private String username;
    //发给谁
    private String toFrom;
    //是不是系统消息
    private boolean systemMess;
    private Set<String> keys;
    public Message() {
    }

    public Message(String message, String toFrom, boolean systemMess) {
        this.message = message;
        this.toFrom = toFrom;
        this.systemMess = systemMess;
    }

    public Message(String message, String toFrom, boolean systemMess, Set<String> keys) {
        this.message = message;
        this.toFrom = toFrom;
        this.systemMess = systemMess;
        this.keys = keys;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("{");
        sb.append("\"message\" : \"").append(message).append('\"');
        sb.append(",\"messageType\" : \"").append(messageType).append('\"');
        sb.append(",\"username\" : \"").append(username).append('\"');
        sb.append(",\"toFrom\" : \"").append(toFrom).append('\"');
        sb.append(",\"systemMess\" : \"").append(systemMess).append('\"');
        sb.append(",\"keys\" : \"").append(keys).append('\"');
        sb.append('}');
        return sb.toString();
    }

    public Message(String message, int messageType, String toFrom, boolean systemMess, Set<String> keys) {
        this.message = message;
        this.messageType = messageType;
        this.toFrom = toFrom;
        this.systemMess = systemMess;
        this.keys = keys;
    }

    public Message(String message, int messageType, String username, String toFrom, boolean systemMess, Set<String> keys) {
        this.message = message;
        this.messageType = messageType;
        this.username = username;
        this.toFrom = toFrom;
        this.systemMess = systemMess;
        this.keys = keys;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getToFrom() {
        return toFrom;
    }

    public void setToFrom(String toFrom) {
        this.toFrom = toFrom;
    }

    public boolean isSystemMess() {
        return systemMess;
    }

    public void setSystemMess(boolean systemMess) {
        this.systemMess = systemMess;
    }

    public Set<String> getKeys() {
        return keys;
    }

    public void setKeys(Set<String> keys) {
        this.keys = keys;
    }

    public int getMessageType() {
        return messageType;
    }

    public void setMessageType(int messageType) {
        this.messageType = messageType;
    }

}
